package sk.tuke.lara.masplc;
// komentar
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.wrapper.AgentContainer;
import jade.wrapper.ControllerException;
import sk.tuke.lara.masplc.agents.BoundedPlcAgent;
import sk.tuke.lara.masplc.agents.OperatorAgent;
import sk.tuke.lara.masplc.agents.PlcAgent;

public class MainJADE {
    public static void main(String[] args) throws ControllerException {
        String host = "localhost"; //"192.168.1.8";
        int port = 1099;
        Profile profile = new ProfileImpl(host, port, "MARJADE");
        profile.setParameter(Profile.GUI, "true");

        //Main container
        AgentContainer container = jade.core.Runtime.instance().createMainContainer(profile);
        try {
            container.start();
            container.createNewAgent("UhelnyHorak1", PlcAgent.class.getName(), null).start();
            container.createNewAgent("UhelnyHorak2", PlcAgent.class.getName(), null).start();
            container.createNewAgent("BiopalivovyHorak4", PlcAgent.class.getName(), null).start();
            container.createNewAgent("PlynovyHorak5", PlcAgent.class.getName(), null).start();
            container.createNewAgent("PlynovyHorak6", BoundedPlcAgent.class.getName(), new Object[] {"PlynovyHorak5"}).start();
            container.createNewAgent("Operator1", OperatorAgent.class.getName(), null).start();
        } catch (Exception ex) {
            ex.printStackTrace();
            System.out.println(ex.getMessage());
        }
    }
}
